<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="org.springframework.jdbc.core.JdbcTemplate"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="java.util.Enumeration"%>
<%@page import="java.net.InetAddress"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<c-rt:set var="ss" value='<%=System.currentTimeMillis()%>'/>

<%@page import="java.util.Arrays"%>
<%@page import="com.yaodian100.core.admin.utils.AdminHelper"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="TENCENT_ONLINE_PAYMENT" content="China TENCENT">
<title>订单测试</title>
<script src="/js/jquery-1.3.2.min.js" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery-ui-1.7.2.custom.min.js"></script>
</head>
<body>
<%
if ( "www.yaodian100.com".equalsIgnoreCase(request.getServerName())){
	out.println("很抱歉，订单测试不支援正式台订单");
}else{
%>
<script language="javascript">
	$().ready(function() {	
		$("#loadingData").dialog({
			  title: '资料处理中,请稍候...',
				bgiframe: true,
				autoOpen: false,
				height: 150,
				width:280,
				modal: true
		});			
		<%--收款--%>
		$("#charge").click(function(){
			if ( "" == $("#chargeOrderId").val() ){
				alert("请输入收款订单编号");
				return;
			}else{
				$.ajax({
				    url: 'http://feeling-nb.yaodian100.com/ecadmin/order/common/chargeOrder.do?ss=' + Math.random(),
				    type: 'post',
				    dataType: 'json',
				    data: {orderId:$("#chargeOrderId").val()},
				    cache: false,
				    beforeSend: function(){
					    $("#loadingData").dialog("open");
				    },
				    success: function( result ){
				    	$("#loadingData").dialog("close");
					    alert(result);
					    location.reload();
				    }
				});
			}
		});
		<%--收款--%>
		$("#charge1").click(function(){
			if ( "" == $("#chargeOrderId1").val() ){
				alert("请输入收款订单编号");
				return;
			}else{
				$.ajax({
				    url: 'http://feeling-nb.yaodian100.com/ecadmin/order/common/deliveryOrderProcess.do?ss=' + Math.random(),
				    type: 'post',
				    dataType: 'json',
				    data: {orderId:$("#chargeOrderId1").val()},
				    cache: false,
				    beforeSend: function(){
					    $("#loadingData").dialog("open");
				    },
				    success: function( result ){
				    	$("#loadingData").dialog("close");
					    alert(result);
					    location.reload();
				    }
				});
			}
		});		
		<%--退货完成--%>
		$("#return").click(function(){
			if ( "" == $("#returnServiceId").val() ){
				alert("请输入退货单号");
				return;
			}else{
				$.ajax({
				    url: 'http://feeling-nb.yaodian100.com/ecadmin/order/common/returnProduct.do?ss=' + Math.random(),
				    type: 'post',
				    dataType: 'json',
				    data: {serviceId:$("#returnServiceId").val()},
				    cache: false,
				    beforeSend: function(){
					    $("#loadingData").dialog("open");
				    },
				    success: function( result ){
				    	$("#loadingData").dialog("close");
					    alert(result);
					    location.reload();
				    }
				});
			}
		});		
		<%--换货完成--%>
		$("#change").click(function(){
			if ( "" == $("#changeServiceId").val() ){
				alert("请输入换货单号");
				return;
			}else{
				$.ajax({
				    url: 'http://feeling-nb.yaodian100.com/ecadmin/order/common/changeProduct.do?ss=' + Math.random(),
				    type: 'post',
				    dataType: 'json',
				    data: {serviceId:$("#changeServiceId").val()},
				    cache: false,
				    beforeSend: function(){
					    $("#loadingData").dialog("open");
				    },
				    success: function( result ){
				    	$("#loadingData").dialog("close");
					    alert(result);
					    location.reload();
				    }
				});
			}
		});			
	});
</script>
<p>收款(部份取消订单用)：</p>
<p>订单编号：<input type="text" id="chargeOrderId1" name="orderId"/><input id="charge1" type="button" value="確定"/></p>
<hr/>
<p>收款：</p>
<p>订单编号：<input type="text" id="chargeOrderId" name="orderId"/><input id="charge" type="button" value="確定"/></p>
<hr/>
<p>退货完成：</p>
<p>退货单号：<input type="text" id="returnServiceId" name="serviceId"/><input id="return" type="button" value="確定"/></p>
<hr/>
<p>换货完成：</p>
<p>换货单号：<input type="text" id="changeServiceId" name="serviceId"/><input id="change" type="button" value="確定"/></p>
<hr/>
</body>
</html>
<div id="loadingData" style="display:none;">
	<img src="/images/loading.gif"/>资料处理中,请稍候...
</div>
<%}%> 